import os

from django import template

register = template.Library()


@register.filter()
def basename(value):
    return os.path.basename(value)


@register.assignment_tag
def define(value=None):
    return value


@register.filter()
def new_line_to_br(value):
    return value.replace('\n', '<br>')
